package com.jswdwsx.esign.repo

import com.jswdwsx.esign.entity.RequestPO
import com.jswdwsx.esign.entity.RequestStatusEnum
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query

interface RequestRepository : JpaRepository<RequestPO, String> {
    fun getByAppIdAndAppSerialNumber(appId: String, appSerialNumber: String): RequestPO?

    @Modifying
    @Query("update RequestPO set status = ?2 where id = ?1")
    fun updateRequest(id: String, status: RequestStatusEnum)
}